
package com.jf.cloud.api.order.feign;

import com.jf.cloud.api.order.bo.EsOrderInvoiceBO;
import com.jf.cloud.common.feign.FeignInsideAuthConfig;
import com.jf.cloud.common.response.ServerResponseEntity;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @author zz
 * @date 2020/11/23
 */
@FeignClient(value = "jfcloud-order", contextId = "order-invoice")
public interface OrderInvoiceFeignClient {

    /**
     * 如果订单没有被取消的话，获取订单金额，否之会获取失败
     *
     * @param orderInvoiceId 订单发票id
     * @return 订单发票数据
     */
    @GetMapping(value = FeignInsideAuthConfig.FEIGN_URL_PREFIX + "/insider/getEsOrderInvoice")
    ServerResponseEntity<EsOrderInvoiceBO> getEsOrderInvoice(@RequestBody Long orderInvoiceId);

    /**
     * 根据订单id获取订单发票的es数据
     * @param orderId
     * @return
     */
    @GetMapping(value = FeignInsideAuthConfig.FEIGN_URL_PREFIX + "/insider/getEsOrderInvoiceByOrderId")
    ServerResponseEntity<EsOrderInvoiceBO> getEsOrderInvoiceByOrderId(@RequestBody Long orderId);
}
